package com.yunji.base.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yunji.base.dao.ISiteLocationTypeDao;
import com.yunji.base.domain.SiteLocationTypeDO;
import com.yunji.base.mapper.ISiteLocationTypeMapper;
import com.yunji.base.params.SiteLocationTypeParam;
import com.yunji.common.base.BaseDaoImpl;
import com.yunji.common.utils.bean.BeanUtils;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SiteLocationTypeDaoImpl extends BaseDaoImpl<ISiteLocationTypeMapper, SiteLocationTypeDO> implements ISiteLocationTypeDao {

    @Override
    public List<SiteLocationTypeDO> searchPage(SiteLocationTypeParam params) {
        return pageList(params,new LambdaQueryWrapper<SiteLocationTypeDO>()
                .like(BeanUtils.isNotNull(params.getLocationTypeName()),SiteLocationTypeDO::getLocationTypeName,params.getLocationTypeName()));
    }
}
